import chats as c


device = ()
ch2 = ()
while True:
    ch1 = c.chat.start()
    if ch1 == 'exit':
        exit()

    elif ch1 == '1':
        ch2 = c.chat.esptool()

    elif ch1 == '2':
        ch2 = c.chat.serials()

    if ch1 == '1':
        if ch2 == 1:
            c.chat.esptool1()
        elif ch2 == 2:
            c.chat.esptool2()
        elif ch2 == 3:
            c.chat.esptool3()
    elif ch1 == '2':
        if ch2 == 1:
            c.chat.serial1()
        elif ch2 == 2:
            device = c.chat.serial2()
        elif ch2 == 3:
            c.chat.serial3(device)
